/* eslint-disable  */
// eslint-disable-next-line
import {
  ModuleLayout
} from '@/layouts'
const ModuleRouteView = {
  name: 'ModuleRouteView',
  render: (h) => h('router-view')
}

export const asyncRouterMap = [
  {
    path: '/',
    redirect: '/portal/module'
  },
  {
    path: '/portal',
    name: 'portal',
    component: ModuleLayout,
    meta: {
      title: 'portal.index'
    },
    children: [
      {
        path: 'module',
        name: 'moduleIndex',
        components: {
          default: () => import('@/views/portal/ModuleWorkplace'),
          // card: null
        },
        meta: {
          mode: 'module'
        },
        children: [
          {
            path: ':moduleName',
            component: ModuleRouteView,
            name: 'moduleLayout',
            children: [
              {
                path: 'pulling',
                component: () => import('@/views/exception/Pulling')
              },
              {
                path: '404',
                component: () => import('@/views/exception/404')
              }
            ]
          }
        ]
      }
    ]
  },
  // {
  //   path: '/portal/module',
  //   name: 'moduleIndex',
  //   component: ModuleLayout,
  //   meta: { title: 'portal.index' },
  //   children: [{
  //     path: ':moduleName',
  //     // component: ModuleRouteView,
  //     component: () => import('@/views/portal/ModuleWorkplace'),
  //     name: 'moduleLayout',
  //     children: [
  //       {
  //         path: 'pulling',
  //         component: () => import('@/views/exception/Pulling')
  //       },
  //       {
  //         path: '404',
  //         component: () => import('@/views/exception/404')
  //       }
  //     ]
  //   }]
  // },
  {
    path: '/404', redirect: '/404', hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  ...asyncRouterMap,
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }

]
